<?php
      //引入php文件
 	include 'connect-sql.php';
	   /*
 * 查询接口
 * username
 * password
 * 
 * 返回json数据
 * 
 * */
  $uid = $_GET['uid'];

	
	$link = connectSql();
	
	$query = "SELECT * FROM wqs WHERE wqs.uid ='$uid' ORDER BY wqs.ptime DESC";
	

	$res = mysqli_query($link, $query);
	//拿到结果集返回的数据
	$newArr=[];
	while($row = mysqli_fetch_array($res, MYSQLI_ASSOC)){
		array_push($newArr,$row);
	}
	
    $arr = [];
	if($res->num_rows){
		$arr['code']=1;
		$arr['data']=$newArr;
	}else{
		$arr['code']=0;
	};
	echo json_encode($arr);
?>